import { createApp } from 'vue'
import './style.css'
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import router from './router'
import axios from 'axios'
// import * as echarts from 'echarts'
import App from './App.vue'

// createApp(App).use(ElementPlus).mount('#app')

// axios.interceptors.response.use(res => {
//     return res.data;
//   })

// const isLogin = ()=>{
//     const options = {
//         method: 'POST',
//         headers: {
//             "X-Requested-With": "XMLHttpRequest",
//             'stu-token':localStorage.getItem("stu-token")
//         },
//         url: 'http://127.0.0.1:8082/sso/isLogin'
//     }
//     axios(options).then(res => {
//         if(res.data == false) {
//             router.push('/')
//         }
//     })
// }

// isLogin()
const app = createApp(App)
app.config.globalProperties.$axios = axios
// app.config.globalProperties.$echarts = echarts
// app.config.globalProperties.$isLogin = isLogin
// 全局注册el-icon
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}


app.use(router)
app.use(ElementPlus)
app.mount('#app')
